package com.wc.alorithm_blue_bridge._前缀和与差分.Q1276;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;

/**
 * @Author congge
 * @Date 2023/10/28 19:56
 * @description 差分数组的应用
 */
public class Answer {
    public static void main(String[] args) {
        Input sc = new Input();
        int n = (int) sc.nextLong();
        int q = (int) sc.nextLong();

        long[] lights = new long[n + 1];
        long[] sub = new long[n + 1];
        for (int i = 1; i <= n; i++) {
            lights[i] = sc.nextLong();
            sub[i] = lights[i] - lights[i - 1];
        }

        while (q-- > 0) {
            int l = (int) sc.nextLong();
            int r = (int) sc.nextLong();
            long x = sc.nextLong();
            sub[l] += x;
            if (r < n) {
                sub[r + 1] -= x;
            }
        }
        for (int i = 1; i <= n; i++) {
            lights[i] = lights[i - 1] + sub[i];
        }
        StringBuffer ans = new StringBuffer();
        if (lights[1] < 0) {
            lights[1] = 0;
        }
        ans.append(lights[1]);
        for (int i = 2; i <= n; i++) {
            ans.append(' ');
            if (lights[i] < 0) {
                lights[i] = 0;
            }
            ans.append(lights[i]);
        }
        System.out.println(ans);
    }

    static class Input {
        StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));

        public long nextLong() {
            try {
                in.nextToken();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return (long) in.nval;
        }
    }
}
